package com.oglvip.business.web.controller;

import com.oglvip.business.dto.ResponseData;
import com.oglvip.business.remote.service.api.PositionService;
import com.oglvip.business.remote.service.api.StoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @auther hanchao
 * @date 2016/12/15 22:16
 */
@RestController
@RequestMapping("/base")
public class BasicInfoController {

    @Autowired
    private StoreService storeService;

    @Autowired
    private PositionService positionService;

    @RequestMapping("/type/list")
    public ResponseData getStoreTypes() {
        return storeService.getStoreTypes();
    }

    @RequestMapping("/position/provinces")
    public ResponseData getProvinces() {
        return positionService.getProvinces();
    }

    @RequestMapping("/position/cities")
    public ResponseData getCities(Integer provinceId) {
        return positionService.getCities(provinceId);
    }

    @RequestMapping("/position/areas")
    public ResponseData getAreas(Integer cityId) {
        return positionService.getAreas(cityId);
    }
}
